<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 导入jq框架 -->
    <script src="../jquery.min.js"></script>
</head>
<body>
    <div id="tip">hello world</div>
    <!-- 添加一个复选框 -->
    <input type="checkbox" name="marry" id="marry" checked>婚否
    <script>
        //获取元素的jq对象
        console.log($("#tip"));
        //jq对象转为原生JS对象
        var tip = $("#tip")[0];
        console.log(tip.innerText);

        //1 使用jq选择器获取元素
        //2 改变元素显示的内容
        document.getElementById("tip").innerText="hello JavaScript";
        $("#tip").html("<b>hello jQuery</b>");
        console.log($("#tip").attr("id"));
        console.log($("#marry").prop("checked"));
    </script>
</body>
</html>